package org.lex.app.prefs;

public class ResourceHelper {
	public static void addAll(ResourceMap src, ResourceMap dest) {
		addAll(src, dest, false);
	}

	/**
	 * ��src�е�������ݣ���ӵ�dest��
	 * 
	 * @param src
	 *            Դ
	 * @param dest
	 *            Ŀ��
	 * @param overwrite
	 *            �Ƿ񸲸�dest�е�ͬ������
	 */
	public static void addAll(ResourceMap src, ResourceMap dest, boolean overwrite) {
		if (overwrite) {
			// ����
			for (String key : src.propertyNames())
				dest.putString(key, src.getString(key));
		} else {
			// ������
			for (String key : src.propertyNames())
				if (false == dest.containsProperty(key))
					dest.putString(key, src.getString(key));
		}
	}

	private ResourceHelper() {
	}
}
